# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 0
n 0(None)[UIItem.__init__(self, *args, **kw)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb765180c>}
nname: 171
n 171(None)[self.text_sel.set_scroll(selected)
return None
]:
	i: 145(f), 160()
	o: 

nname: 160
n 160(None)[]:
	i: 145(t)
	o: 171()

nname: 145
n 145(selected)[]:
	i: 34(), 116()
	o: 160(t), 171(f)

nname: 116
n 116(None)[self._item_name = None
self.widget.set_color(a=0)
]:
	i: 0(f)
	o: 145()

nname: 34
n 34(None)[not_sel, sel = self._get_images_paths(item)
self.icon_sel.load(sel)
self.icon_not_sel.load(not_sel)
self._item_name = item.name
self._update_text(position)
]:
	i: 0(t)
	o: 145()

nname: 0
n 0(item is not None)[UIItem.reset(self, item, selected, position)
]:
	i: 
	o: 34(t), 116(f)

nname: 171
n 171(None)[self.text_sel.set_scroll(selected)
return None
]:
	i: 0(f)
	o: 

nname: 0
n 0(None)[UIItem.reset(self, item, selected, position)
if item is not None:
	not_sel, sel = self._get_images_paths(item)
	self.icon_sel.load(sel)
	self.icon_not_sel.load(not_sel)
	self._item_name = item.name
	self._update_text(position)
else:
	self._item_name = None
	self.widget.set_color(a=0)
if selected:
	pass
]:
	i: 
	o: 171()

nname: 0
n 0(None)[UIItem.reset(self, item, selected, position)
if item is not None:
	not_sel, sel = self._get_images_paths(item)
	self.icon_sel.load(sel)
	self.icon_not_sel.load(not_sel)
	self._item_name = item.name
	self._update_text(position)
else:
	self._item_name = None
	self.widget.set_color(a=0)
if selected:
	pass
self.text_sel.set_scroll(selected)
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7651fec>}
nname: 62
n 62(None)[return None
]:
	i: 40(JA), 57(), 61()
	o: 

nname: 61
n 61(None)[]:
	i: 0(f)
	o: 62()

nname: 57
n 57(None)[]:
	i: 15(f)
	o: 62()

nname: 40
n 40(None)[self._update_text(position)
]:
	i: 15(t)
	o: 62(JA)

nname: 15
n 15(self._item_name is not None)[self._position = position
]:
	i: 0(t)
	o: 40(t), 57(f)

nname: 0
n 0(position != self._position)[]:
	i: 
	o: 15(t), 61(f)

nname: 0
n 0(None)[if position != self._position:
	self._position = position
	if self._item_name is not None:
		self._update_text(position)
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7651b6c>}
nname: 161
n 161(None)[return None
]:
	i: 59(), 95(), 160(AE)
	o: 

nname: 95
n 95(None)[name = name.decode('utf_8').encode('ascii', 'replace')
self.text_not_sel.set_text(name)
self.text_sel.set_text(name)
]:
	i: 56(except)
	o: 161()

nname: 59
n 59(None)[self.text_not_sel.set_text(name)
self.text_sel.set_text(name)
]:
	i: 56(try)
	o: 161()

nname: 56
n 56(None)[]:
	i: 35(), 55()
	o: 59(try), 95(except)

nname: 55
n 55(None)[]:
	i: 0&21(f)
	o: 56()

nname: 35
n 35(None)[name = '%d. %s' % (position, name)
]:
	i: 0&21(t)
	o: 56()

nname: 0&21
n 0&21(position is not None and self.style['enumerated'])[name = self._item_name
]:
	i: 
	o: 35(t), 55(f)

nname: 95
n 95(None)[except:
	name = name.decode('utf_8').encode('ascii', 'replace')
	self.text_not_sel.set_text(name)
	self.text_sel.set_text(name)
return None
]:
	i: 0&21()
	o: 

nname: 0&21
n 0&21(None)[name = self._item_name
if position is not None and self.style['enumerated']:
	name = '%d. %s' % (position, name)
try:
	self.text_not_sel.set_text(name)
	self.text_sel.set_text(name)
]:
	i: 
	o: 95()

nname: 0&21
n 0&21(None)[name = self._item_name
if position is not None and self.style['enumerated']:
	name = '%d. %s' % (position, name)
try:
	self.text_not_sel.set_text(name)
	self.text_sel.set_text(name)
except:
	name = name.decode('utf_8').encode('ascii', 'replace')
	self.text_not_sel.set_text(name)
	self.text_sel.set_text(name)
return None
]:
	i: 
	o: 

self.nodes: {'0&21': <unpyclib.structure.node instance at 0xb7651ecc>}
nname: 0
n 0(None)[self._item_name = None
style = self.style
img_sel = Image()
img_not_sel = Image()
preserve_icon_size = style['preserve_icon_size']
img_sel.set_keep_real_size(preserve_icon_size)
img_not_sel.set_keep_real_size(preserve_icon_size)
maxlen = style['maxlen']
text_not_sel = TextBlock(max_width=maxlen)
text_not_sel.set_color(color=style['text_color'])
text_sel = TextBlock(max_width=maxlen, autoscroll=style['autoscroll'])
text_sel.set_color(color=style['selected_text_color'])
text_sel.set_style(style=style['selected_font_style'])
text_not_sel.set_style(style=style['font_style'])
self.text_not_sel = text_not_sel
self.text_sel = text_sel
self.icon_not_sel = img_not_sel
self.icon_sel = img_sel
c = Container()
c_sel = Container()
tw, th = style['text_size']
iw, ih = style['icon_size']
left, top = style['text_offset']
c.add_child(text_not_sel, width=tw, height=th, top=top, left=left)
c.add_child(img_not_sel, width=iw, height=ih, right='100%', valign='50%')
tw, th = style['selected_text_size']
iw, ih = style['selected_icon_size']
left, top = style['selected_text_offset']
c_sel.add_child(text_sel, width=tw, height=th, top=top, left=left)
c_sel.add_child(img_sel, width=iw, height=ih, right='100%', valign='50%')
return (c, c_sel)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb765d1ec>}
nname: 48
n 48(None)[self.text_sel.set_scroll(selected)
]:
	i: 0(f), 37()
	o: 

nname: 37
n 37(None)[]:
	i: 0(t)
	o: 48()

nname: 0
n 0(selected)[UIItem._set_selected(self, selected, *args, **kw)
]:
	i: 
	o: 37(t), 48(f)

nname: 0
n 0(None)[UIItem._set_selected(self, selected, *args, **kw)
if selected:
	pass
self.text_sel.set_scroll(selected)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb765194c>}
nname: 0
n 0(None)[self.text_sel.set_text('')
self.text_not_sel.set_text('')
self.text_sel.set_scroll(False)
self.icon_sel.load(None)
self.icon_not_sel.load(None)
return UIItem.destroy(self)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7651c8c>}
nname: 6
n 6(None)[__slots__ = ['_selected', '_marked', '_position', '_edited', 'widget', 'style', '_item_name', 'text_sel', 'text_not_sel', 'icon_sel', 'icon_not_sel', '_not_selected_widget', '_selected_widget']
def __init__(self, *args, **args):
	UIItem.__init__(self, *args, **kw)

def reset(self, item, selected, position=None):
	UIItem.reset(self, item, selected, position)
	if item is not None:
		not_sel, sel = self._get_images_paths(item)
		self.icon_sel.load(sel)
		self.icon_not_sel.load(not_sel)
		self._item_name = item.name
		self._update_text(position)
	else:
		self._item_name = None
		self.widget.set_color(a=0)
	if selected:
		pass
	self.text_sel.set_scroll(selected)
	return None

def set_position(self, position):
	if position != self._position:
		self._position = position
		if self._item_name is not None:
			self._update_text(position)
	return None

def _update_text(self, position):
	name = self._item_name
	if position is not None and self.style['enumerated']:
		name = '%d. %s' % (position, name)
	try:
		self.text_not_sel.set_text(name)
		self.text_sel.set_text(name)
	except:
		name = name.decode('utf_8').encode('ascii', 'replace')
		self.text_not_sel.set_text(name)
		self.text_sel.set_text(name)
	return None

def _create(self):
	self._item_name = None
	style = self.style
	img_sel = Image()
	img_not_sel = Image()
	preserve_icon_size = style['preserve_icon_size']
	img_sel.set_keep_real_size(preserve_icon_size)
	img_not_sel.set_keep_real_size(preserve_icon_size)
	maxlen = style['maxlen']
	text_not_sel = TextBlock(max_width=maxlen)
	text_not_sel.set_color(color=style['text_color'])
	text_sel = TextBlock(max_width=maxlen, autoscroll=style['autoscroll'])
	text_sel.set_color(color=style['selected_text_color'])
	text_sel.set_style(style=style['selected_font_style'])
	text_not_sel.set_style(style=style['font_style'])
	self.text_not_sel = text_not_sel
	self.text_sel = text_sel
	self.icon_not_sel = img_not_sel
	self.icon_sel = img_sel
	c = Container()
	c_sel = Container()
	tw, th = style['text_size']
	iw, ih = style['icon_size']
	left, top = style['text_offset']
	c.add_child(text_not_sel, width=tw, height=th, top=top, left=left)
	c.add_child(img_not_sel, width=iw, height=ih, right='100%', valign='50%')
	tw, th = style['selected_text_size']
	iw, ih = style['selected_icon_size']
	left, top = style['selected_text_offset']
	c_sel.add_child(text_sel, width=tw, height=th, top=top, left=left)
	c_sel.add_child(img_sel, width=iw, height=ih, right='100%', valign='50%')
	return (c, c_sel)

def _set_selected(self, selected, *args, **args):
	UIItem._set_selected(self, selected, *args, **kw)
	if selected:
		pass
	self.text_sel.set_scroll(selected)

def destroy(self):
	self.text_sel.set_text('')
	self.text_not_sel.set_text('')
	self.text_sel.set_scroll(False)
	self.icon_sel.load(None)
	self.icon_not_sel.load(None)
	return UIItem.destroy(self)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb764dc0c>}
nname: 153
n 153(None)[from peewee.debug import GET_LOGGER
log = GET_LOGGER(__name__)
class IconTextItem(UIItem):
	__slots__ = ['_selected', '_marked', '_position', '_edited', 'widget', 'style', '_item_name', 'text_sel', 'text_not_sel', 'icon_sel', 'icon_not_sel', '_not_selected_widget', '_selected_widget']
	def __init__(self, *args, **args):
		UIItem.__init__(self, *args, **kw)

	def reset(self, item, selected, position=None):
		UIItem.reset(self, item, selected, position)
		if item is not None:
			not_sel, sel = self._get_images_paths(item)
			self.icon_sel.load(sel)
			self.icon_not_sel.load(not_sel)
			self._item_name = item.name
			self._update_text(position)
		else:
			self._item_name = None
			self.widget.set_color(a=0)
		if selected:
			pass
		self.text_sel.set_scroll(selected)
		return None

	def set_position(self, position):
		if position != self._position:
			self._position = position
			if self._item_name is not None:
				self._update_text(position)
		return None

	def _update_text(self, position):
		name = self._item_name
		if position is not None and self.style['enumerated']:
			name = '%d. %s' % (position, name)
		try:
			self.text_not_sel.set_text(name)
			self.text_sel.set_text(name)
		except:
			name = name.decode('utf_8').encode('ascii', 'replace')
			self.text_not_sel.set_text(name)
			self.text_sel.set_text(name)
		return None

	def _create(self):
		self._item_name = None
		style = self.style
		img_sel = Image()
		img_not_sel = Image()
		preserve_icon_size = style['preserve_icon_size']
		img_sel.set_keep_real_size(preserve_icon_size)
		img_not_sel.set_keep_real_size(preserve_icon_size)
		maxlen = style['maxlen']
		text_not_sel = TextBlock(max_width=maxlen)
		text_not_sel.set_color(color=style['text_color'])
		text_sel = TextBlock(max_width=maxlen, autoscroll=style['autoscroll'])
		text_sel.set_color(color=style['selected_text_color'])
		text_sel.set_style(style=style['selected_font_style'])
		text_not_sel.set_style(style=style['font_style'])
		self.text_not_sel = text_not_sel
		self.text_sel = text_sel
		self.icon_not_sel = img_not_sel
		self.icon_sel = img_sel
		c = Container()
		c_sel = Container()
		tw, th = style['text_size']
		iw, ih = style['icon_size']
		left, top = style['text_offset']
		c.add_child(text_not_sel, width=tw, height=th, top=top, left=left)
		c.add_child(img_not_sel, width=iw, height=ih, right='100%', valign='50%')
		tw, th = style['selected_text_size']
		iw, ih = style['selected_icon_size']
		left, top = style['selected_text_offset']
		c_sel.add_child(text_sel, width=tw, height=th, top=top, left=left)
		c_sel.add_child(img_sel, width=iw, height=ih, right='100%', valign='50%')
		return (c, c_sel)

	def _set_selected(self, selected, *args, **args):
		UIItem._set_selected(self, selected, *args, **kw)
		if selected:
			pass
		self.text_sel.set_scroll(selected)

	def destroy(self):
		self.text_sel.set_text('')
		self.text_not_sel.set_text('')
		self.text_sel.set_scroll(False)
		self.icon_sel.load(None)
		self.icon_not_sel.load(None)
		return UIItem.destroy(self)



]:
	i: 74(), 116(), 151(AE)
	o: 

nname: 151
n 151(None)[]:
	i: 106(f)
	o: 153(AE)

nname: 116
n 116(None)[from pygui.gui.widget import Image, TextBlock, Container
]:
	i: 106(t)
	o: 153()

nname: 106
n 106(<dummy_ex3> EXC_MATCH ImportError)[]:
	i: 0(except)
	o: 116(t), 151(f)

nname: 74
n 74(None)[from wyvas import Image, TextBlock, Container
]:
	i: 63(), 73()
	o: 153()

nname: 73
n 73(None)[]:
	i: 35(f)
	o: 74()

nname: 63
n 63(None)[raise ImportError
]:
	i: 35(t)
	o: 74()

nname: 35
n 35('cython' not in wyvas_version)[from wyvas import __version__ as wyvas_version
]:
	i: 0(try)
	o: 63(t), 73(f)

nname: 0
n 0(None)[from __future__ import absolute_import
from .ui_items import UIItem
]:
	i: 
	o: 35(try), 106(except)

nname: 153
n 153(None)[from peewee.debug import GET_LOGGER
log = GET_LOGGER(__name__)
class IconTextItem(UIItem):
	__slots__ = ['_selected', '_marked', '_position', '_edited', 'widget', 'style', '_item_name', 'text_sel', 'text_not_sel', 'icon_sel', 'icon_not_sel', '_not_selected_widget', '_selected_widget']
	def __init__(self, *args, **args):
		UIItem.__init__(self, *args, **kw)

	def reset(self, item, selected, position=None):
		UIItem.reset(self, item, selected, position)
		if item is not None:
			not_sel, sel = self._get_images_paths(item)
			self.icon_sel.load(sel)
			self.icon_not_sel.load(not_sel)
			self._item_name = item.name
			self._update_text(position)
		else:
			self._item_name = None
			self.widget.set_color(a=0)
		if selected:
			pass
		self.text_sel.set_scroll(selected)
		return None

	def set_position(self, position):
		if position != self._position:
			self._position = position
			if self._item_name is not None:
				self._update_text(position)
		return None

	def _update_text(self, position):
		name = self._item_name
		if position is not None and self.style['enumerated']:
			name = '%d. %s' % (position, name)
		try:
			self.text_not_sel.set_text(name)
			self.text_sel.set_text(name)
		except:
			name = name.decode('utf_8').encode('ascii', 'replace')
			self.text_not_sel.set_text(name)
			self.text_sel.set_text(name)
		return None

	def _create(self):
		self._item_name = None
		style = self.style
		img_sel = Image()
		img_not_sel = Image()
		preserve_icon_size = style['preserve_icon_size']
		img_sel.set_keep_real_size(preserve_icon_size)
		img_not_sel.set_keep_real_size(preserve_icon_size)
		maxlen = style['maxlen']
		text_not_sel = TextBlock(max_width=maxlen)
		text_not_sel.set_color(color=style['text_color'])
		text_sel = TextBlock(max_width=maxlen, autoscroll=style['autoscroll'])
		text_sel.set_color(color=style['selected_text_color'])
		text_sel.set_style(style=style['selected_font_style'])
		text_not_sel.set_style(style=style['font_style'])
		self.text_not_sel = text_not_sel
		self.text_sel = text_sel
		self.icon_not_sel = img_not_sel
		self.icon_sel = img_sel
		c = Container()
		c_sel = Container()
		tw, th = style['text_size']
		iw, ih = style['icon_size']
		left, top = style['text_offset']
		c.add_child(text_not_sel, width=tw, height=th, top=top, left=left)
		c.add_child(img_not_sel, width=iw, height=ih, right='100%', valign='50%')
		tw, th = style['selected_text_size']
		iw, ih = style['selected_icon_size']
		left, top = style['selected_text_offset']
		c_sel.add_child(text_sel, width=tw, height=th, top=top, left=left)
		c_sel.add_child(img_sel, width=iw, height=ih, right='100%', valign='50%')
		return (c, c_sel)

	def _set_selected(self, selected, *args, **args):
		UIItem._set_selected(self, selected, *args, **kw)
		if selected:
			pass
		self.text_sel.set_scroll(selected)

	def destroy(self):
		self.text_sel.set_text('')
		self.text_not_sel.set_text('')
		self.text_sel.set_scroll(False)
		self.icon_sel.load(None)
		self.icon_not_sel.load(None)
		return UIItem.destroy(self)



]:
	i: 74(), 106()
	o: 

nname: 106
n 106(None)[except ImportError:
	from pygui.gui.widget import Image, TextBlock, Container
]:
	i: 0()
	o: 153()

nname: 74
n 74(None)[from wyvas import Image, TextBlock, Container
]:
	i: 0()
	o: 153()

nname: 0
n 0(None)[from __future__ import absolute_import
from .ui_items import UIItem
try:
	from wyvas import __version__ as wyvas_version
	if 'cython' not in wyvas_version:
		raise ImportError
]:
	i: 
	o: 74(), 106()

self.nodes: {0: <unpyclib.structure.node instance at 0xb764d92c>, 74: <unpyclib.structure.node instance at 0xb7644a4c>, 153: <unpyclib.structure.node instance at 0xb7644e2c>, 106: <unpyclib.structure.node instance at 0xb764d5cc>}
from __future__ import absolute_import
from .ui_items import UIItem
try:
	from wyvas import __version__ as wyvas_version
	if 'cython' not in wyvas_version:
		raise ImportError
